<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> 
<%@ page isELIgnored="false"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'itemdetail_list.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
   itemdetail_list
   <c:forEach var="lItemdetail" items="${lItemdetails}">
      <form action="<%=path %>/itemdetail/update.htm" method="post" >
       <tr>
       
           <td>name<input type="text" value="${lItemdetail.name}" name="name"/></td>
          <td><select name="parentid">
          <c:forEach var="litem" items="${lItems1}">
            <c:choose>
              <c:when test="${lItemdetail.parentid == litem.id }">
                  <option value="${litem.id }" selected="selected">${litem.name}</option>
              </c:when>
              <c:otherwise>
                   <option value="${litem.id }">${litem.name }</option>
              </c:otherwise>
            
            </c:choose>
             
          </c:forEach>
         </select></td>
            <td>desc<input type="text" value="${lItemdetail.descript}" name="descript"/></td>
            <td>price<input type="text" value="${lItemdetail.price}" name="price"/></td>
             <td> discount<input type="text"  value="${lItemdetail.discount}" name="discount"/></td>
             <td><img src="<%=path %>${lItemdetail.file_path}"/></td>
            <td><input type="hidden" value="${lItemdetail.id}" name="id"/></td>
           
             <td><input type="submit" value="修改"/></td>
             <td><a href="<%=request.getContextPath() %>/itemdetail/delete/${lItemdetail.id}.htm">删除</a></td>
       </tr></form><br/>
    
    </c:forEach>
   
   
   
   
   
   
  </body>
</html>
